﻿<!DOCTYPE html>
<!--隐患管理-隐患等级管理-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>

    <script>

    </script>
</head>

<body>

    <div id="app" v-cloak>
        <el-row>
            <el-col :span="24">
                <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                         style="margin-bottom: 15px;">

                    <el-row>
                        <el-col class="head-tool">

                            <div class="new_title fl">
                                <strong><img src="/static/images/icon1.png" />隐患级别管理列表</strong>
                            </div>

                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                     @click="onSubmit"></btn>
                                <btn :text="col.btnAdd" linetype="3" @click="UserInput('tj')"></btn>
                                <btn-template-download tempname="yh/隐患管理_隐患级别管理.xlsx"></btn-template-download>

                                <btn-uploadfile-list url="/api/YH_Grade/Import" linetype="3"></btn-uploadfile-list>
                                <btn-export-list url="/api/YH_Grade/Export" :forminline="this.formInline"></btn-export-list>
                                <btn :text="col.btnDelete" linetype="4" @click="onDelete"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>

                        <list-factorys-all v-model="formInline.model.CreateFactory" @change="factoryChange"></list-factorys-all>
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.Level"
                                              :placeholder="RisksManagement.RiskLevel.Level" size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.RiskLevel.Level+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>


                    </el-row>

                </el-form>
                <el-table stripe ref="table" :data="ListItem.tableData" :height="ListItem.tableHeight" border
                          @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                    <el-table-column type="selection" align="center" width="55">
                    </el-table-column>

                    <el-table-column type="index" :label="RisksManagement.RiskLevel.id" :index="indexMethod" width="50" align="center"
                                     show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="level" :label="RisksManagement.RiskLevel.Level" show-overflow-tooltip="true" align="center"
                                     min-width="50">
                    </el-table-column>
                    <el-table-column prop="isMajor" :label="'是否重大'" show-overflow-tooltip="true" align="center" min-width="50">
                        <template scope="scope">
                            {{scope.row.isMajor?'是':'否'}}
                        </template>
                    </el-table-column>

                    
                    <el-table-column prop="postNames" :label="'通知岗位'" min-width="200" align="center"
                                     show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="remark" :label="RisksManagement.RiskLevel.Remark" min-width="100" align="center"
                                     show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column width="100" prop="update" :label="'操作'" fixed="right" align="center">
                        <template slot-scope="scope">
                            <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                                <i class="el-icon-edit"></i>
                            </button>
                            <button type="button" class="elst-bt-xg" @click=DutyInput('xg',scope.row.id)>
                                <i class="el-icon-setting"></i>
                            </button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-row type="flex" justify="end">

                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                   :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                                   :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination>

                </el-row>
            </el-col>
        </el-row>
        <el-dialog :title="dialogTitle" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog'
                   width="80%" height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    //页面内数据初始化
                    ListItem: ListItem,
                    dialogTitle:'隐患级别管理',
                    formInline: {
                        model: {
                            Level: ''
                        },
                        offset: 0,
                        limit: 10
                    }
                }
            },
            mounted: function () {
                //初始化数据
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                factoryChange: function () {
                    this.GetPageData(1);
                },
                //表格序号连续化
                indexMethod: function (index) { return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1; },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/YH_Grade/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { this.dialogTitle = "隐患级别管理"; DialogShow(this, val, "RiskLevelInput.html", id); },
                DutyInput: function (val, id) { this.dialogTitle = "设置通知岗位"; DialogShow(this, val, "RiskLevelDutyInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/YH_Grade/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>

</html>